package com.internetCafes.spms.web.toolbox.cont;

/**
 * 资质常量
 */
public class QualiConst {

    /**
     * 资质类型
     */
    public enum TypeTag {
        EPC(1, "总承包"),
        PROFESSIONAL_CONTRACTORS(2, "专业承包"),
        ;
        /**
         * id
         */
        private Integer tag;

        /**
         * 等级类型
         */
        private String type;

        TypeTag(Integer tag, String type) {
            this.tag = tag;
            this.type = type;
        }

        public Integer getTag() {
            return tag;
        }

        public String getType() {
            return type;
        }
    }

    /**
    * 资质等级 0-特级 1-一级 2-二级 3-三级
    * descrMap.put(SPECIAL, "特级");
    * descrMap.put(FIRST, "壹级");
    * descrMap.put(SECOND, "贰级");
    * descrMap.put(THIRD, "叁级");
     */
    public enum GradeType {
        NULL(-1, "无"),
        SPECIAL(0, "特级"),
        FIRST(1, "一级"),
        SECOND(2, "二级"),
        THIRD(3, "三级"),
        NO_GRADE(4, "不分等级"),
        ;

        /**
         * id
         */
        private Integer tag;

        /**
         * 等级类型
         */
        private String type;

        GradeType(Integer tag, String type) {
            this.tag = tag;
            this.type = type;
        }

        public Integer getTag() {
            return tag;
        }

        public String getType() {
            return type;
        }

        public static String getTypeByTag(Integer tag) {
            for (GradeType type : values()) {
                if (type.getTag().equals(tag)) {
                    return type.getType();
                }
            }
            return "其他";
        }
    }
}
